﻿// Copyright (c) 2014 Jonathan Magnan (http://jonathanmagnan.com/).
// All rights reserved (http://zzzproject.com/sqlbulkcopy-extensions/).
// Licensed under MIT License (MIT) (https://zsqlbulkcopy.codeplex.com/license/).
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace Z.Net.Extensions
{
    internal partial class SqlBulkOperation
    {
        public SqlBulkOperation()
        {
            Config = new SqlBulkOperationConfig();
        }

        /// <summary>Gets or sets the parameter mapping.</summary>
        /// <value>The parameter mapping.</value>
        public Dictionary<string, int> ParameterMapping { get; set; }

        /// <summary>Gets or sets the SqlBulkOperation setting.</summary>
        /// <value>The SqlBulkOperation setting.</value>
        public SqlBulkOperationSetting Setting { get; set; }

        /// <summary>Gets or sets the SqlBulkOperation configuration.</summary>
        /// <value>The SqlBulkOperation configuration.</value>
        public SqlBulkOperationConfig Config { get; set; }

        /// <summary>Gets or sets the state of the data row to perform a Bulk Operation.</summary>
        /// <value>The data row state to perform a Bulk Operation.</value>
        public DataRowState? DataRowState { get; set; }

        /// <summary>Gets or sets the data source.</summary>
        /// <value>The data source.</value>
        public object DataSource { get; set; }

        /// <summary>Gets or sets the data source as a list.</summary>
        /// <value>A data source as a list.</value>
        private List<object> DataSourceAsList { get; set; }

        /// <summary>Gets or sets the internal data source.</summary>
        /// <value>The internal data source.</value>
        private object InternalDataSource { get; set; }

        /// <summary>Gets or sets a value indicating whether this object use an internal transaction.</summary>
        /// <value>true if this object use an internal transaction, false if not.</value>
        private bool IsInternalTransaction { get; set; }

        /// <summary>Gets or sets a list of mappings.</summary>
        /// <value>A List of mappings.</value>
        private List<SqlBulkCopyColumnMapping> MappingList { get; set; }

        /// <summary>Gets or sets the SQL action bulk 1.</summary>
        /// <value>The SQL action bulk 1.</value>
        private string SqlActionBulk1 { get; set; }

        /// <summary>Gets or sets the SQL action bulk 2.</summary>
        /// <value>The SQL action bulk 2.</value>
        private string SqlActionBulk2 { get; set; }

        /// <summary>Gets or sets the SQL action drop temporary table.</summary>
        /// <value>The SQL action drop temporary table.</value>
        private string SqlActionDropTemporaryTable { get; set; }

        /// <summary>Gets or sets the SQL bulk copy.</summary>
        /// <value>The SQL bulk copy.</value>
        public System.Data.SqlClient.SqlBulkCopy SqlBulkCopy { get; set; }

        /// <summary>Gets or sets the SQL connection.</summary>
        /// <value>The SQL connection.</value>
        private SqlConnection SqlConnection { get; set; }

        /// <summary>Gets or sets the SQL transaction.</summary>
        /// <value>The SQL transaction.</value>
        private SqlTransaction SqlTransaction { get; set; }

        /// <summary>Gets or sets the name of the temporary column.</summary>
        /// <value>The name of the temporary column.</value>
        private string TemporaryColumnName { get; set; }

        /// <summary>Gets or sets the name of the temporary table.</summary>
        /// <value>The name of the temporary table.</value>
        private string TemporaryTableName { get; set; }
    }
}